<!DOCTYPE HTML>

<html>

<head>

    <meta charset="utf-8">

    <meta name="renderer" content="webkit|ie-comp|ie-stand">

    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

    <meta name="viewport"
        content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />

    <meta http-equiv="Cache-Control" content="no-siteapp" />

    <link rel="Bookmark" href="/favicon.ico">

    <link rel="Shortcut Icon" href="/favicon.ico" />

    <!--[if lt IE 9]>

<script type="text/javascript" src="lib/html5shiv.js"></script>

<script type="text/javascript" src="lib/respond.min.js"></script>

<![endif]-->

    <link rel="stylesheet" type="text/css" href="/public/static/admin/static/h-ui/css/H-ui.min.css" />

    <link rel="stylesheet" type="text/css" href="/public/static/admin/static//h-ui.admin/css/H-ui.admin.css" />

    <link rel="stylesheet" type="text/css" href="/public/static/admin/lib/Hui-iconfont/1.0.8/iconfont.css" />

    <link rel="stylesheet" type="text/css" href="/public/static/admin/static/h-ui.admin/skin/default/skin.css"
        id="skin" />

    <link rel="stylesheet" type="text/css" href="/public/static/admin/static/h-ui.admin/css/style.css" />

    <link rel="stylesheet" type="text/css" href="/public/static/admin/css/common.css" />

    <link rel="stylesheet" type="text/css" href="/public/static/index/css/font-awesome.min.css" />

    <script type="text/javascript" src="/public/static/admin/lib/jquery/1.9.1/jquery.min.js"></script>

    <title>后台管理系统</title>



</head>

<body>



    <body>

        <article class="page-container">

            <form class="form form-horizontal" id="form-admin-add" action="" method="post">





                <div class="row cl">

                    <label class="form-label col-xs-4 col-sm-3">用户组名称：</label>

                    <div class="formControls col-xs-8 col-sm-9">

                        <input type="text" class="input-text" value="{$authGroupData.title}" placeholder="" name="title"
                            required="true">

                        <input type="hidden" class="input-text" value="{$authGroupData.id}" placeholder="" name="id"
                            required="true">

                    </div>

                </div>



                <div class="row cl">

                    <label class="form-label col-xs-4 col-sm-3">分配权限：</label>

                    <div class="formControls col-xs-8 col-sm-9">

                        <!-- 权限分配 -->

                        <table class="table table-hover">

                            <thead class="bordered-darkorange">

                                <tr>

                                    <th>

                                        <label style="padding:0 15px 0 0;">

                                            <input id="chkAll" onclick="CheckAll(this.form)" value="全选" type="checkbox"
                                                class="colored-success checkbox-parent" type="checkbox">

                                            <span class="text">权限全选</span>

                                        </label>

                                    </th>

                                </tr>

                            </thead>

                            <tbody>

                                {volist name="$authRuleData" id="vo"}
                                <tr>

                                    <td>

                                        <label style="padding-right:15px;">

                                            <input id="{$vo.id}" value="{$vo.id}" name="rules[]" dataid="id-{$vo.id}"
                                                class="colored-success checkbox-parent" type="checkbox" 
                                                {php}
                                                if(in_array($vo['id'],$rulesArr)){echo 'checked';}
                                                {/php}>

                                            <span class="text">{$vo.title}</span>

                                        </label>

                                    </td>

                                </tr>
                                    {if condition='$vo.children'}
                                        {volist name="$vo.children" id="vo1"}
                                        <tr>

                                            <td style="padding-left:30px;">

                                                <label style="padding-right:15px;">

                                                    <input class="colored-success checkbox-parent checkbox-child" id="{$vo1.id}"
                                                        value="{$vo1.id}" name="rules[]" dataid="id-{$vo.id}-{$vo1.id}" type="checkbox" {php}
                                                        if(in_array($vo1['id'],$rulesArr)){echo 'checked';}
                                                        {/php}>

                                                    <span class="text">{$vo1.title}</span>

                                                </label>

                                            </td>

                                        </tr>
                                        {/volist}
                                    {/if}
                                {/volist}


                                






                            </tbody>

                        </table>

                        <!-- 权限分配 -->

                    </div>

                </div>





                <div class="row cl">

                    <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">

                        <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">

                    </div>

                </div>

            </form>

        </article>



        <!--_footer 作为公共模版分离出去-->



        <script type="text/javascript" src="/public/static/admin/lib/layer/2.4/layer.js"></script>

        <script type="text/javascript" src="/public/static/admin/static/h-ui/js/H-ui.min.js"></script>

        <script type="text/javascript" src="/public/static/admin/static/h-ui.admin/js/H-ui.admin.js"></script>



        <script type="text/javascript" src="/public/static/admin/layui/layui.js"></script>



        <script type="text/javascript" src="/public/static/admin/lib/ueditor/1.4.3/ueditor.config.js"></script>

        <script type="text/javascript" src="/public/static/admin/lib/ueditor/1.4.3/ueditor.all.min.js"> </script>

        <script type="text/javascript" src="/public/static/admin/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>

        <script src="/public/static/admin/lib/My97DatePicker/4.8/WdatePicker.js"></script>



        <script src="/public/static/admin/js/common.js"></script><!-- 后台公共自定义js -->




        <!--请在下方写此页面业务相关的脚本-->

        <script type="text/javascript" src="lib/jquery.validation/1.14.0/jquery.validate.js"></script>

        <script type="text/javascript" src="lib/jquery.validation/1.14.0/validate-methods.js"></script>

        <script type="text/javascript" src="lib/jquery.validation/1.14.0/messages_zh.js"></script>

        <script type="text/javascript">

            /* 权限配置 */

            $(function () {

                //动态选择框，上下级选中状态变化

                $('input.checkbox-parent').on('change', function () {

                    var dataid = $(this).attr("dataid");

                    $('input[dataid^=' + dataid + ']').prop('checked', $(this).is(':checked'));

                });

                $('input.checkbox-child').on('change', function () {

                    var dataid = $(this).attr("dataid");

                    dataid = dataid.substring(0, dataid.lastIndexOf("-"));

                    var parent = $('input[dataid=' + dataid + ']');

                    if ($(this).is(':checked')) {

                        parent.prop('checked', true);

                        //循环到顶级

                        while (dataid.lastIndexOf("-") != 2) {

                            dataid = dataid.substring(0, dataid.lastIndexOf("-"));

                            parent = $('input[dataid=' + dataid + ']');

                            parent.prop('checked', true);

                        }

                    } else {

                        //父级

                        if ($('input[dataid^=' + dataid + '-]:checked').length == 0) {

                            parent.prop('checked', false);

                            //循环到顶级

                            while (dataid.lastIndexOf("-") != 2) {

                                dataid = dataid.substring(0, dataid.lastIndexOf("-"));

                                parent = $('input[dataid=' + dataid + ']');

                                if ($('input[dataid^=' + dataid + '-]:checked').length == 0) {

                                    parent.prop('checked', false);

                                }

                            }

                        }

                    }

                });

            });

        </script>

        <!--/请在上方写此页面业务相关的脚本-->


        <script type="text/javascript">
            (function () {
                var tab_tit = document.getElementById('think_page_trace_tab_tit').getElementsByTagName('span');
                var tab_cont = document.getElementById('think_page_trace_tab_cont').getElementsByTagName('div');
                var open = document.getElementById('think_page_trace_open');
                var close = document.getElementById('think_page_trace_close').children[0];
                var trace = document.getElementById('think_page_trace_tab');
                var cookie = document.cookie.match(/thinkphp_show_page_trace=(\d\|\d)/);
                var history = (cookie && typeof cookie[1] != 'undefined' && cookie[1].split('|')) || [0, 0];
                open.onclick = function () {
                    trace.style.display = 'block';
                    this.style.display = 'none';
                    close.parentNode.style.display = 'block';
                    history[0] = 1;
                    document.cookie = 'thinkphp_show_page_trace=' + history.join('|')
                }
                close.onclick = function () {
                    trace.style.display = 'none';
                    this.parentNode.style.display = 'none';
                    open.style.display = 'block';
                    history[0] = 0;
                    document.cookie = 'thinkphp_show_page_trace=' + history.join('|')
                }
                for (var i = 0; i < tab_tit.length; i++) {
                    tab_tit[i].onclick = (function (i) {
                        return function () {
                            for (var j = 0; j < tab_cont.length; j++) {
                                tab_cont[j].style.display = 'none';
                                tab_tit[j].style.color = '#999';
                            }
                            tab_cont[i].style.display = 'block';
                            tab_tit[i].style.color = '#000';
                            history[1] = i;
                            document.cookie = 'thinkphp_show_page_trace=' + history.join('|')
                        }
                    })(i)
                }
                parseInt(history[0]) && open.click();
                tab_tit[history[1]].click();
            })();
        </script>
    </body>

</html>